import csv

with open('scores.csv','r') as file:
   reader = csv.reader(file)
   next(reader)
   data = list(reader)

#print(data)

scores = []

for row in data:
    #print(row)
    scores.append(int(row[2]))

print(scores)
    #for score in scores:
        #print(score)
def calc_mean(scores):
    return sum(scores) / len(scores)

def calc_median(scores):
    sorted_scores = sorted(scores)
    n = len(sorted_scores)
    if n % 2 == 0:
        return (sorted_scores[n // 2 - 1] + sorted_scores[n // 2]) / 2
    else:
        return sorted_scores[n // 2]

def calc_mode(scores):
    score_count = {}
    for score in scores:
        if score in score_count:
            score_count[score] += 1
        else:
            score_count[score] = 1
    return max(score_count,key=score_count.get)

mean = calc_mean(scores)
median = calc_median(scores)
mode = calc_mode(scores)

print(f"The mean is {mean}")
print(f"The median is {median}")
print(f"The mode is {mode}")